<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrganizeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('organize', function (Blueprint $table) {
            $table->increments('id');
            $table->string('organize_name')->index()->comment('组织名');
            $table->unsignedInteger('organize_pid')->index()->comment('上级组织ID');
            $table->string('organize_pid_path')->index()->comment('上级组织路径');
            $table->string('organize_desc')->comment('组织简述');
            $table->timestamps();
            $table->softDeletes();
            $table->engine = "InnoDB";
            $table->charset = "utf8mb4";
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('organize');
    }
}
